package edu.kjxy.day03.synchronizedBlockLockAll.test1;

/**
 * 功能:当多个线程同时执行synchronized（x）{}同步代码快时呈同步效果。
 * 作者:程序员欧阳子韩
 * 日期:2024/2/2 19:44
 */
public class RunTest1 {
    public static void main(String[] args) {
        Service service = new Service();
        MyObject object = new MyObject();
        ThreadA threadA = new ThreadA(service,object);
        threadA.setName("a");
        threadA.start();
        ThreadB threadB = new ThreadB(service,object);
        threadB.setName("b");
        threadB.start();
    }
}
